// import request from "../utils/request";
import axios from './axios'

/* 
  需要使用以下方式引入
  在使用的文件中:
    import {方法} from "../../requests/api_export";
    方法(params)
  在这个文件中:
  export function findAllDe() {
    return axios({
      method: "get",
      url: '/findAllDe'
    })
  }

  export function getDeByCondition(data) {
    return axios({
      method: "post",
      url: "/getDeByCondition",
      data: data,
    })
  }
*/

/*
  需要使用以下方式引入
    import api from "../../requests/api_export";
    api.方法(params)
  在这个文件中
  export default {
    getDeByCondition(data) {
      return request({
        method: "post",
        url: "/getDeByCondition",
        data: data,
      })
    }
  }
*/
export default {
  DeTypeLink_findAll: () => {
    return axios({
      method: "get",
      url: '/DeTypeLink/findAll'
    })
  },
  DeType_find: () => {
    return axios({
      method: "get",
      url: "/DeType/All"
    })
  },
  updateDeType: (data) => {
    return axios({
      method: "post",
      url: '/DeType/sync',
      data: data
    })
  },
  SyncDeTypeLink: () => {
    return axios({
      method: "get",
      url: '/sync/DeTypeLink'
    })
  },
  updateDeTypeLink: (data) => {
    return axios({
      method: "post",
      url: '/DeTypeLink/Update',
      data: data
    })
  },
  countAllDeEntity: () => {
    return axios({
      method: "get",
      url: '/countAllDeEntity'
    })
  },

  //1
  setIndexExample: (data) => {
    return axios({
      method: 'post',
      url: '/De/SetExample',
      data: data,
    })
  },
  //1
  getIndexExample: () => {
    return axios({
      method: 'get',
      url: '/De/Example'
    })
  },

  //1
  findAllLocRef: () => {
    return axios({
      method: "get",
      url: '/LocRef/All'
    })
  },

  //1
  findAllDeType: () => {
    return axios({
      method: "get",
      url: '/DeType/All'
    })
  },

  //1
  getDeByCondition(data) {
    return axios({
      method: "post",
      url: "/De/condition",
      data: data,
    })
  },


  //1
  countImage() {
    return axios({
      method: "get",
      url: "/countImage/All",
    })
  }, countImageByType() {
    return axios({
      method: "get",
      url: "/countImage/All/ByTpe",
    })
  }, countImageByPP() {
    return axios({
      method: "get",
      url: "/countImage/All/ByPP",
    })
  },

  //1
  findDeById(params) {
    return axios({
      method: "post",
      url: "/De/Id",
      params: params
    })
  },
  // 获取最新id
  newId(idName) {
    return axios({
      method: "post",
      url: "/Id/newId",
      params: { idName: idName },
    })
  },


  editDe_DefLib(de, deOri) {
    return axios({
      method: "post",
      url: "/editDe",
      data: {
        de: de,
        deOri: deOri
      }
    })
  },
  deleteDe(ppid, deid) {
    return axios({
      method: "post",
      url: "/De/Delete",
      params: {
        ppid: ppid,
        deid: deid
      }
    })
  }
}
